import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  { path: '/login', component: () => import('../views/login/index.vue') },
  {
    path: '/',
    component: () => import('../views/layout/index.vue'),
    children: [
      { path: '', component: () => import('../views/home/index.vue') },
      { path: '/qa', component: () => import('../views/qa/index.vue') },
      { path: '/video', component: () => import('../views/video/index.vue') },
      { path: '/my', component: () => import('../views/my/index.vue') }
    ]
  },
  { path: '/search', component: () => import('../views/search/index.vue') }, // 搜索
  { path: '/article/:articleId', component: () => import('@/views/article/index.vue'), props: true },
  { path: '/user/profile', component: () => import('../views/userProfile/index.vue') }
]

const router = new VueRouter({
  routes
})

export default router
